package com.gton.lpl.controller;


import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author GuoTong
 * @since 2021-10-21
 */
@RestController
@RequestMapping("/gp-rule")
@Api(tags = {"权限管理控制台"})
public class GpRuleController {


    @RequestMapping(value = "/getSession", method = RequestMethod.GET)
    public Object getSession(HttpServletRequest request) {
        HttpSession session = request.getSession();
        Object username = session.getAttribute("abcd");
        Object userinfo = session.getAttribute("userinfo");
        return userinfo;
    }

    @RequestMapping(value = "/setSession", method = RequestMethod.GET)
    public Object setSession(HttpServletRequest request) {
        HttpSession session = request.getSession();
        session.setAttribute("abcd","abc");
        return session;
    }

}

